{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "kxu1Gfhx1pHg"
   },
   "source": [
    "<a href=\"https://colab.research.google.com/github/jeffheaton/app_generative_ai/blob/main/t81_559_class_11_2_dashboard.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "ZbNbAV281pHh"
   },
   "source": [
    "# T81-559: Applications of Generative Artificial Intelligence\n",
    "**Module 11: Finetuning**\n",
    "* Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), McKelvey School of Engineering, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx)\n",
    "* For more information visit the [class website](https://sites.wustl.edu/jeffheaton/t81-558/)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "HwnvSYEQ1pHi"
   },
   "source": [
    "# Module 11 Material\n",
    "\n",
    "Module 11: Finetuning\n",
    "\n",
    "* Part 11.1: Understanding Finetuning [[Video]](https://www.youtube.com/watch?v=fflySydZABM) [[Notebook]](t81_559_class_11_1_finetune.ipynb)\n",
    "* **Part 11.2: Finetuning from the Dashboard** [[Video]](https://www.youtube.com/watch?v=RIJj1QLk-V4) [[Notebook]](t81_559_class_11_2_dashboard.ipynb)\n",
    "* Part 11.3: Finetuning from Code [[Video]](https://www.youtube.com/watch?v=29tUrxrneOs) [[Notebook]](t81_559_class_11_3_code.ipynb)\n",
    "* Part 11.4: Evaluating your Model [[Video]](https://www.youtube.com/watch?v=MrwFSG4PWUY) [[Notebook]](t81_559_class_11_4_eval.ipynb)\n",
    "* Part 11.5: Finetuning for Text to Image [[Video]](https://www.youtube.com/watch?v=G_FYFSzkB5Y&list=PLjy4p-07OYzulelvJ5KVaT2pDlxivl_BN) [[Notebook]](t81_559_class_11_5_image.ipynb)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "v2MPPX0c1pHi"
   },
   "source": [
    "# Part 11.2: Finetuning from the Dashboard\n",
    "\n",
    "We will start by fine-tuning our models using the OpenAI website. In the next part, we will learn how to use the API. For now, we will use the following two files to fine-tune. The first is the training data; we will use the second to validate our training.\n",
    "\n",
    "* [sarcastic.jsonl](https://data.heatonresearch.com/data/t81-559/finetune/sarcastic.jsonl)\n",
    "* [sarcastic_val.jsonl](https://data.heatonresearch.com/data/t81-559/finetune/sarcastic_val.jsonl)\n",
    "\n",
    "We begin by creating a few fine-tuned models. You will need to upload the two training files to the training dialog to enter all of the training parameters.\n",
    "\n",
    "![Finetune 1](https://data.heatonresearch.com/images/wustl/app_genai/finetune_1.jpg)\n",
    "\n",
    "It will then validate your files before beginning the training.\n",
    "\n",
    "![Finetune 2](https://data.heatonresearch.com/images/wustl/app_genai/tinetune_2.jpg)\n",
    "\n",
    "Once the training is complete, you will see your finalized model. Understanding that OpenAI does not allow you to delete pretrained models is essential. However, you are also not charged for keeping models uploaded. OpenAI only charges you for training and inference time.\n",
    "\n",
    "![Finetune 3](https://data.heatonresearch.com/images/wustl/app_genai/finetune_3.jpg)\n",
    "\n",
    "Finally, we can test the finetuned model.\n",
    "\n",
    "![Finetune 4](https://data.heatonresearch.com/images/wustl/app_genai/finetune_4.jpg)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
